
message("vtkdemo_dicom:======")
message("CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}")

find_package(OpenCV REQUIRED )

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

find_package(VTK REQUIRED)

find_package( Ceres REQUIRED)

# eigen support
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR}
    ${ME_SOURCE_DIR}
    ${CERES_INCLUDE_DIR}
    )

# 读取单一的文件并显示
ADD_EXECUTABLE(vtk_ReadDICOM vtk_ReadDICOM.cpp)
TARGET_LINK_LIBRARIES(vtk_ReadDICOM ${VTK_LIBRARIES} ${OpenCV_LIBS})

# 读取多个文件
ADD_EXECUTABLE(vtk_ReadDICOMSeries vtk_ReadDICOMSeries.cpp)
TARGET_LINK_LIBRARIES(vtk_ReadDICOMSeries ${VTK_LIBRARIES})

# 读取并显示立体图像
ADD_EXECUTABLE(vtk_MarchingCubes vtk_MarchingCubes.cpp)
TARGET_LINK_LIBRARIES(vtk_MarchingCubes ${VTK_LIBRARIES})

# 读取并显示立体图像
ADD_EXECUTABLE(vtk_ViewDicom3D vtk_ViewDicom3D.cpp
    ${ME_MEMATH_SRCS} ${ME_MEMATH_HDRS}
   ${ME_VTKMATH})
TARGET_LINK_LIBRARIES(vtk_ViewDicom3D ${VTK_LIBRARIES} ${OpenCV_LIBS})

# DICOM 文件解析
ADD_EXECUTABLE(vtk_DICOMParser vtk_DICOMParser.cpp
    MeBlobDector.h MeBlobDector.cpp)
TARGET_LINK_LIBRARIES(vtk_DICOMParser ${VTK_LIBRARIES} ${OpenCV_LIBS})


# 计算投影H矩阵，并三维图像到 png
ADD_EXECUTABLE(Vtk_ProjectionImage Vtk_ProjectionImage.cpp
     ${ME_MEMATH_SRCS} ${ME_MEMATH_HDRS}
    ${ME_VTKMATH})
TARGET_LINK_LIBRARIES(Vtk_ProjectionImage ${VTK_LIBRARIES} ${ITK_LIBRARIES} ${OpenCV_LIBS})
# 计算投影H矩阵，VTK显示
ADD_EXECUTABLE(Vtk_ProjectionImage2 Vtk_ProjectionImage2.cpp
     ${ME_MEMATH_SRCS} ${ME_MEMATH_HDRS}
    ${ME_VTKMATH})
TARGET_LINK_LIBRARIES(Vtk_ProjectionImage2 ${VTK_LIBRARIES} ${ITK_LIBRARIES} ${OpenCV_LIBS})
vtk_module_autoinit(TARGETS Vtk_ProjectionImage2 MODULES ${VTK_LIBRARIES})
# 计算投影H矩阵，VTK显示，可不停旋转
ADD_EXECUTABLE(Vtk_ProjectionImage3 Vtk_ProjectionImage3.cpp
     ${ME_MEMATH_SRCS} ${ME_MEMATH_HDRS}
    ${ME_VTKMATH})
TARGET_LINK_LIBRARIES(Vtk_ProjectionImage3 ${VTK_LIBRARIES} ${ITK_LIBRARIES} ${OpenCV_LIBS})
vtk_module_autoinit(TARGETS Vtk_ProjectionImage3 MODULES ${VTK_LIBRARIES})
